home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
XGBLKSPI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-27
|
1KB
|
41 lines
/* xgblkspi.c 4.3 */
/*F****************************************************************************
FUNCTION NAME: xgblkspi
ACTION: Reads/writes count characters from/to the SPI port
to/from an array of bytes (unsigned short).
PARAMETERS:
array: pointer to an array of bytes. This array is
first read from to get a byte to output, then
the same location is written with the byte
input from the port.
count: number of bytes to be read/written.
RETURNS: (void)
******************************************************************************/
#include <hc11/directives.h>
SMALL
void xgblkspi(array, count)
unsigned short *array; /* pointer to data to be read/written */
int count; /* number of bytes to be read/written */
{
/****************************************************************/
/* Note that "while ((count--) > 0)" is equivalent to */
/* "while ((--count) >= 0)" but the pre-decrement version */
/* is more efficient than the post-decrement version. */
/****************************************************************/
while ((--count) >= 0)
*(array++) = xgbytspi((unsigned) *(array));
} /* end of xgblkspi */